Kanzi 4.0.0-beta2
kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView > Class Template Reference

#include <kanzi/ui/node/concept/list_box/list_box_trajectory_presenter.hpp>

Inheritance diagram for kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >:
[legend]

Classes

struct  KzuTrajectoryLayoutSnapInfo
 

Public Types

using BaseClass
 
using ItemSharedPtr
 
using LayoutSharedPtr
 
using ListBoxTrajectoryPresenterType
 
using ScrollViewSharedPtr
 

Public Member Functions

void addToLayout (ItemSharedPtr listBoxItem)
 
void bringItemCenter (size_t selection, bool smooth)
 Brings given item to the selector position.
 
void enableKeyNavigation (bool enabled)
 Enables directional key navigation on the Trajectory Presenter.
 
KzuVirtualItemIterator findMiddleIterator ()
 
LayoutSharedPtr getLayout () const
 
void initialize (TFinalClass *listBox, LayoutSharedPtr layout)
 
bool isEffectivelyLooping () const
 Returns whether presentation is in looping mode.
 
 ListBoxTrajectoryPresenter ()
 
void notifyItemAdded (size_t index)
 Implements notifyItemAdded for a trajectory list box.
 
void notifyItemContainerChanged ()
 Invalidates layout if the item container is changed.
 
void notifyItemRemoved (size_t index)
 Implements notifyItemRemoved for a trajectory list box.
 
void notifyItemReplaced (size_t)
 Implements kzuPresenterItemReplaced for trajectory list box.
 
void removeFromLayout (ItemSharedPtr listBoxItem)
 
void setScroll (Vector2 scroll)
 
void snap (Vector2 position, Vector2 direction, bool changeTarget, Vector2 *out_position, int *out_itemIndex)
 Snaps from a given position towards a given direction.
 
void tryMoveFocusInDirection (ListBoxConcept::FocusMoveTarget target, bool fallback=false)
 Tries to move the focus to the next or previous item in a Trajectory List Box node.
 
void tryMoveFocusToEdge (ListBoxConcept::FocusMoveTarget target, bool fallback=false)
 Tries to move the focus to the first or last item in a Trajectory List Box node.
 
void tryMoveFocusToPage (ListBoxConcept::FocusMoveTarget target, bool fallback=false)
 
void update ()
 Updates presenter's state and visible items.
 
 ~ListBoxTrajectoryPresenter ()
 
- Public Member Functions inherited from kanzi::ListBoxScrollPresenterConceptImpl< ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >, TFinalClass, TScrollView >
ScrollViewSharedPtr getScrollView () const
 Returns the Scroll View that the presenter uses.
 
void initialize (TFinalClass *listBox)
 ListBoxScrollPresenterConceptImpl specific initialization.
 
 ListBoxScrollPresenterConceptImpl ()=default
 Constructor.
 

Protected Member Functions

bool calculateAliveItemsRange ()
 Sets indices and offsets of first and last alive items and the number of alive elements.
 
void extendAliveItemsRangeToItem (size_t index)
 Extends the alive items range of the presenter to include the item at a given index.
 
ItemSharedPtr getItem (size_t presenterIndex) const
 
size_t getItemCount () const
 Gets number of items in presenters list box.
 
Vector3 getItemSize (size_t itemIndex)
 Returns the size of an item at a given index.
 
bool isHorizontalScroll () const
 Returns whether the Trajectory List Box is scrolling horizontally.
 
void iterateLeft (KzuVirtualItemIterator *it)
 Iterates leftward in a virtual item list.
 
void iterateRight (KzuVirtualItemIterator *it)
 Iterates rightward in a virtual item list.
 
void iterateToIndex (KzuVirtualItemIterator *iterator, size_t index)
 Iterates the iterator to the given index.
 
void snapImprove (KzuTrajectoryLayoutSnapInfo *snap, unsigned int objectIndex, float offset, float selectorOffset, kzBool snapLeft, kzBool snapRight)
 
void updateAliveItemsRange ()
 Asks the List Box to update the items in the layout according to the currently set firstIndex and rangeSize, taking into account also the keep alive items.
 
- Protected Member Functions inherited from kanzi::ListBoxScrollPresenterConceptImpl< ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >, TFinalClass, TScrollView >
void onClickBegin (ClickManipulator::ClickBeginMessageArguments &messageArguments)
 Handles ClickManipulator::onClickBeginMessage.
 
void onItemSelected (ListBoxConcept::ItemSelectedMessageArguments &messageArguments)
 Handles ListBoxConcept::ItemSelectedMessage.
 
void onScrolled (ScrollViewConcept::ScrolledMessageArguments &messageArguments)
 Handles ScrollViewClass::ScrolledMessage.
 
void onScrollFinished (ScrollViewConcept::ScrollFinishedMessageArguments &messageArguments)
 Handles ScrollViewClass::ScrollFinishedMessage.
 
void onScrollStarted (ScrollViewConcept::ScrollStartedMessageArguments &messageArguments)
 Handles ScrollViewClass::ScrollStartedMessage.
 
void onSnapRequested (ScrollViewConcept::SnapRequestMessageArguments &messageArguments)
 Handles ScrollViewClass::SnapRequestMessage.
 
void onUserScrollFinished (ScrollViewConcept::UserScrollFinishedMessageArguments &messageArguments)
 Handles ScrollViewClass::UserScrollFinishedMessage.
 
void onUserScrollStarted (ScrollViewConcept::UserScrollStartedMessageArguments &messageArguments)
 Handles ScrollViewClass::UserScrollStartedMessage.
 
void scrollToTargetItem (size_t itemIndex, Vector2 scrollPosition, bool smooth) const
 Requests Scroll View to scroll to target item position.
 
void sendListBoxTargetChangedMessage (size_t targetItem) const
 Sends ListBoxScrollPresenterConcept::TargetChangedMessage message to List Box.
 
void sendScrollViewSetScrollMessage (const Vector2 &scrollPosition) const
 Sends ScrollViewConcept::SetScrollMessage message to Scroll View.
 
void sendScrollViewSetScrollTargetMessage (const Vector2 &scrollTarget) const
 Sends ScrollViewConcept::SetScrollTargetMessage message to Scroll View.
 

Static Protected Member Functions

static unsigned int kzuTrajectoryLayoutPresenterItemCountFunction_internal (void *userData)
 Gets list box's total item count.
 
static kzsError kzuTrajectoryLayoutPresenterItemListSizeFunction_internal (unsigned int index, void *userData, Vector3 &size)
 Gets object's size by index.
 
static float kzuTrajectoryLayoutPresenterItemWidthFunction_internal (const Vector3 size)
 Gets object's width from its size for virtual item list.
 

Additional Inherited Members

- Protected Attributes inherited from kanzi::ListBoxScrollPresenterConceptImpl< ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >, TFinalClass, TScrollView >
TFinalClass * m_listBox
 List Box that owns this presenter.
 

Member Typedef Documentation

◆ ListBoxTrajectoryPresenterType

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
using kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::ListBoxTrajectoryPresenterType

◆ BaseClass

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
using kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::BaseClass

◆ LayoutSharedPtr

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
using kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::LayoutSharedPtr

◆ ItemSharedPtr

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
using kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::ItemSharedPtr

◆ ScrollViewSharedPtr

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
using kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::ScrollViewSharedPtr

Constructor & Destructor Documentation

◆ ListBoxTrajectoryPresenter()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::ListBoxTrajectoryPresenter ( )
inlineexplicit

◆ ~ListBoxTrajectoryPresenter()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::~ListBoxTrajectoryPresenter ( )
inline

Member Function Documentation

◆ getLayout()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
LayoutSharedPtr kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::getLayout ( ) const
inline

◆ notifyItemAdded()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::notifyItemAdded ( size_t index)
inline

Implements notifyItemAdded for a trajectory list box.

Called by the ListBoxConceptImpl after the item has been added.

Parameters
indexIndex of the item that was added.

◆ notifyItemRemoved()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::notifyItemRemoved ( size_t index)
inline

Implements notifyItemRemoved for a trajectory list box.

Called by the ListBoxConceptImpl after the item is removed.

Parameters
indexIndex of the item that will be removed.

◆ notifyItemReplaced()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::notifyItemReplaced ( size_t )
inline

Implements kzuPresenterItemReplaced for trajectory list box.

◆ notifyItemContainerChanged()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::notifyItemContainerChanged ( )
inline

Invalidates layout if the item container is changed.

◆ initialize()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::initialize ( TFinalClass * listBox,
LayoutSharedPtr layout )
inline

◆ isEffectivelyLooping()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
bool kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::isEffectivelyLooping ( ) const
inline

Returns whether presentation is in looping mode.

Since
Kanzi 4.0.0

◆ enableKeyNavigation()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::enableKeyNavigation ( bool enabled)
inline

Enables directional key navigation on the Trajectory Presenter.

Parameters
enabledTo enable key navigation, pass true. To disable key navigation, pass false.
Since
Kanzi 3.9.1

◆ tryMoveFocusInDirection()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::tryMoveFocusInDirection ( ListBoxConcept::FocusMoveTarget target,
bool fallback = false )
inline

Tries to move the focus to the next or previous item in a Trajectory List Box node.

Parameters
targetWhere to move the focus:
fallbackWhether to set the focus to the List Box node when there is no focusable list item in the target.
Since
Kanzi 4.0.0

◆ tryMoveFocusToPage()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::tryMoveFocusToPage ( ListBoxConcept::FocusMoveTarget target,
bool fallback = false )
inline

◆ tryMoveFocusToEdge()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::tryMoveFocusToEdge ( ListBoxConcept::FocusMoveTarget target,
bool fallback = false )
inline

Tries to move the focus to the first or last item in a Trajectory List Box node.

Parameters
targetWhere to move the focus:
fallbackWhether to set the focus to the List Box node when there is no focusable list item in the target.
Since
Kanzi 4.0.0

◆ update()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::update ( )
inline

Updates presenter's state and visible items.

◆ setScroll()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::setScroll ( Vector2 scroll)
inline

◆ addToLayout()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::addToLayout ( ItemSharedPtr listBoxItem)
inline

◆ removeFromLayout()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::removeFromLayout ( ItemSharedPtr listBoxItem)
inline

◆ findMiddleIterator()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
KzuVirtualItemIterator kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::findMiddleIterator ( )
inline

◆ bringItemCenter()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::bringItemCenter ( size_t selection,
bool smooth )
inline

Brings given item to the selector position.

◆ snap()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::snap ( Vector2 position,
Vector2 direction,
bool changeTarget,
Vector2 * out_position,
int * out_itemIndex )
inline

Snaps from a given position towards a given direction.

Returns the snapping target and the index of the item to which the scrolling snapped, unless they are given as nullptr. If the list box target changes to the snapped item, changeTarget is KZ_TRUE. If the snapping did not target any item, the index is -1.

◆ calculateAliveItemsRange()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
bool kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::calculateAliveItemsRange ( )
inlineprotected

Sets indices and offsets of first and last alive items and the number of alive elements.

Sets the values of viewInternal member.

Since
Kanzi 4.0.0 changed calculateVisibleRange to calculateAliveItemsRange.

◆ updateAliveItemsRange()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::updateAliveItemsRange ( )
inlineprotected

Asks the List Box to update the items in the layout according to the currently set firstIndex and rangeSize, taking into account also the keep alive items.

Since
Kanzi 4.0.0 changed updateVisibleRange to updateAliveItemsRange.

◆ getItem()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
ItemSharedPtr kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::getItem ( size_t presenterIndex) const
inlineprotected

◆ iterateLeft()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::iterateLeft ( KzuVirtualItemIterator * it)
inlineprotected

Iterates leftward in a virtual item list.

If the size of an item, to which the iterator points, cannot otherwise be determined, this operation can extend the alive items range of the presenter.

Parameters
itIterator to iterate.

◆ iterateRight()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::iterateRight ( KzuVirtualItemIterator * it)
inlineprotected

Iterates rightward in a virtual item list.

If the size of an item, to which the iterator points, cannot otherwise be determined, this operation can extend the alive items range of the presenter.

Parameters
itIterator to iterate.

◆ snapImprove()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::snapImprove ( KzuTrajectoryLayoutSnapInfo * snap,
unsigned int objectIndex,
float offset,
float selectorOffset,
kzBool snapLeft,
kzBool snapRight )
inlineprotected

◆ kzuTrajectoryLayoutPresenterItemWidthFunction_internal()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
static float kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::kzuTrajectoryLayoutPresenterItemWidthFunction_internal ( const Vector3 size)
inlinestaticprotected

Gets object's width from its size for virtual item list.

◆ extendAliveItemsRangeToItem()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::extendAliveItemsRangeToItem ( size_t index)
inlineprotected

Extends the alive items range of the presenter to include the item at a given index.

If the item is already in the alive items range, the range does not change.

Parameters
indexIndex of the item to include in the alive items range.
Since
Kanzi 4.0.0 changed extendVisibleItemsRangeToItem to extendAliveItemsRangeToItem.

◆ getItemSize()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
Vector3 kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::getItemSize ( size_t itemIndex)
inlineprotected

Returns the size of an item at a given index.

If the item is outside the alive items range of the presenter and the List Box cannot determine the size of the item, this operation extends the alive items range.

Parameters
itemIndexThe index of the item whose size you want to get.
Returns
The size of the item.

◆ getItemCount()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
size_t kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::getItemCount ( ) const
inlineprotected

Gets number of items in presenters list box.

Returns
item count.

◆ kzuTrajectoryLayoutPresenterItemListSizeFunction_internal()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
static kzsError kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::kzuTrajectoryLayoutPresenterItemListSizeFunction_internal ( unsigned int index,
void * userData,
Vector3 & size )
inlinestaticprotected

Gets object's size by index.

◆ kzuTrajectoryLayoutPresenterItemCountFunction_internal()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
static unsigned int kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::kzuTrajectoryLayoutPresenterItemCountFunction_internal ( void * userData)
inlinestaticprotected

Gets list box's total item count.

◆ iterateToIndex()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::iterateToIndex ( KzuVirtualItemIterator * iterator,
size_t index )
inlineprotected

Iterates the iterator to the given index.

◆ isHorizontalScroll()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
bool kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::isHorizontalScroll ( ) const
inlineprotected

Returns whether the Trajectory List Box is scrolling horizontally.

Returns
If the Trajectory List Box is scrolling horizontally, true. If the Trajectory List Box is scrolling vertically, false.

The documentation for this class was generated from the following file: